|
|

楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////) Z) U3 i; P4 ]+ v: O4 B
// Theme Option
1 A0 F( ~% u% B. ?3 q, j5 F////////////////////////////////////////////////////////////////////////////////* G$ W' b, D) I9 V! Z: w
! ~2 P) |$ \# M- ?/ R- F" V$themename = "Zenx";" O6 E9 f$ V* r, ^2 x2 I7 _* ?/ C
$shortname = str_replace(' ', '_', strtolower($themename));
0 ^9 E/ O8 V- `
1 c, C! q. @( ]# g8 `1 J' I' c( T& Sfunction get_theme_option($option); O, P% A1 \& J# ~
{
. S) f5 m4 P1 D' f global $shortname;3 W! O5 h* l$ i9 a/ d; x0 x4 U2 W" t
return stripslashes(get_option($shortname . '_' . $option));- }# d o# y, i& B9 [2 G
}
+ x! p$ g4 E) B* {
1 F& N7 Z, V4 d4 o0 n+ c& T; d' k) @function get_theme_settings($option)8 Q* b$ j- A% Q: G7 Z
{& c7 y' q/ I+ e5 b% V
return stripslashes(get_option($option));
3 d |' G8 t% q4 A}0 J4 k' ^ _. K( T
$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC");
4 y) p( I4 u" b# h2 a9 b$wp_getcat = array();/ L+ H5 D+ h9 {( ]
foreach ($wp_dropdown_rd_admin as $category_list) {1 O0 ~. X7 N# l) W3 T
$wp_getcat[$category_list->term_id] = $category_list->name;) }7 F' a+ G6 _% l% l5 X0 M# M
}9 n y- H% O8 D! k7 s
$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
4 K. ^- A) u* e1 N: P' h) P$ L$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
2 p- L) h4 a: C# q# x# L, R# G( R$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");
- |$ ?. q( R3 h0 h3 _
( N9 m3 a ^8 k' M$options = array (1 G4 S( O0 o7 S2 ?& ?, W- a
; B( G& [6 J5 m) J/ [* _6 `- F V
) }4 e0 ~1 g: N- ~$ k h array( "name" => "Blog Header Settings",
# I3 u5 |/ N$ M+ O7 u "type" => "heading",5 Y3 {3 F _0 N
),1 P1 |% Z, H/ J! c. A
! `0 ~( t8 G: O# R% ]( E; v9 A
array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",( M3 o1 P; ?* q$ a
"id" => $shortname."_header_logo_activate",
, t+ f! \/ W: ?5 C "type" => "select",% b/ q& I2 Y' G2 l
"std" => "No",6 @/ F s1 c/ b5 N7 L- o, ^
"options" => array("No", "Yes")),% q8 Z9 x0 G' b% |: ?) g( O+ A
|; Y* F; e5 `0 H% v0 @# ?! o2 G7 B
array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",
6 r; T# I6 f% O1 G h! A "id" => $shortname."_logo_url",
: o6 O( H$ z3 U& u "type" => "text",
T9 U/ |4 @' e- \ "box" => "social",
7 e$ E5 g# S" ]% C) f "std" => "",( x( y; V3 b: a2 E* V: F
),
. \. S: X3 W9 [! s/ R# L- e
2 Q4 { ?- Z" o, E' a/ Z% S array( "name" => "Insert Header Banner HTML Code (Header)
% c0 Q @0 {* L& s6 ? <br /><em>*Recommended Size 468 x 60</em>6 K; k" ^. x, M/ y3 T& X
<br /><em>*leave blank if not use</em>",' Q% Z* o6 Q( N% l3 i- t& ~
"id" => $shortname."_header_banner",
/ \" _% g* _8 d! p "type" => "textarea",3 x8 \; s0 K* @8 i- U% v
"std" => "",! V6 O6 O- @4 V/ h/ n# B
),0 B$ _, t, P9 i4 _' `8 N
" P7 A7 W; E! c9 i* ]. j8 [- |
array( "name" => "</div></div>",# m$ U' d" C- O4 R: O+ E* q
"type" => "close",( _6 f7 I7 i+ R# w3 g
),
) @; r3 \+ D% L2 O* M& p
& t! M; J0 B% V1 B* C, P1 G+ r5 g8 L# \ j8 P
array( "name" => "Header Navigation Settings",
; K! e6 h( ?! x# k$ F: @+ D; }; E0 V "type" => "heading",* x6 z0 }5 X/ [; h2 y8 u( c& [
),6 z5 P% _ B0 V+ A6 @ y
1 t4 r" v+ w7 m2 }( j array( "name" => "Insert Page ID To Exclude On Header Navigation<br />
$ g- g$ L! o5 k4 F) b' N <em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
2 I4 C% c. k4 Z5 Z. K5 Z ~ <em>*Enter the page post ID number only</em><br />4 I5 b( x. {: @8 f# ~ S8 z4 v
<em>*separate by comma</em><br />7 Z" d ~3 n" g7 |5 A7 ?
<em>*Exclude pages which you don't want to show on the header navigation</em>",
& R. @6 g: ?& H2 X4 r( Z "id" => $shortname."_header_page_navigation",
2 @+ {1 D+ n5 E# B+ s, W4 D "type" => "text",
4 H S: Q) X) ] r. ~ "std" => "",0 a9 ~0 ?3 J5 V. D
),0 d: A. I8 B( ^0 C$ \
+ ^7 a: r' U6 I# U( I; [/ D8 c
array( "name" => "</div></div>",
- g5 N+ B& r5 m e3 W7 q, L0 D "type" => "close",
3 {; f, J# P& r4 [% g5 W ),3 f' j# u( X+ q6 U' q
, i* i! V2 D7 z0 t
9 M! |, s& J0 k5 x+ M7 g' h array( "name" => "Post Auto Thumbnails Settings",5 b" b& h$ \7 m: C% P. Z) U* E
"type" => "heading",) C0 d l. |3 ]; \0 [$ r) f' c0 ^
),. l2 k6 C: f: e4 g4 }! Z
; f0 {3 L7 ~4 E# _2 V% O array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
! E+ i! ?1 Z9 r "id" => $shortname."_timthumb_activate",
* R3 j0 `+ g! N6 h "type" => "select",' u/ N. q) }" P* z
"std" => "No",
2 ^* }0 C) B- I/ ^/ |/ ] "options" => array("No", "Yes")),
4 D* \+ Z, V; X, g
) @7 R) q; P4 M# p array( "name" => "If Timthumb is enabled, Please choose its cropping method",& H `4 _, X. n! S: ^3 y
"id" => $shortname."_timthumb_cropping",
) _) n. q) H8 M+ H3 D" y# W "type" => "select",
# V: ~0 B) k$ f" D3 ] "std" => "",8 f- ?- N3 l; z. d" m
"options" => $crop_position),
5 g; Q$ W6 S: v5 V7 {# n; E+ m" d2 n+ p4 P/ |6 e7 W8 {
array( "name" => "Insert Width Of Thumbnail Image<br />
. ~" s1 v( J# U6 y; m0 x. e <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />- `$ T1 _. W- i0 O. Z7 ^
<em>*Leave Blank To Use Default: 250</em><br />",4 w6 {" U9 b7 R6 B/ m7 J# t
"id" => $shortname."_thumb_width",
6 a) \( q/ n8 x1 |: e "type" => "text",
7 a, r# X2 O4 O/ [: W: Z2 h "std" => "",( o Y d- e0 a- W: [
),
: \7 n2 Q5 y5 b M; W; {3 \8 v! o; K' B, P P
array( "name" => "Insert Height Of Thumbnail Image<br />$ v+ ^ H5 X- p9 }0 Y% V
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />! a1 D3 C3 W0 r3 y# {
<em>*Leave Blank To Use Default: 200</em><br />",
. P0 a* t+ G- a0 h! R1 e "id" => $shortname."_thumb_height",
8 h! k9 b0 { z! l4 |. W! p2 `7 |) j7 ]/ w "type" => "text",( i" D5 U& a- `! a- c4 w" Y2 c
"std" => "",
& ?9 Q9 a3 U0 _$ [( X* b ),
2 L. h( f7 N- E/ o( d: _2 F. s1 X, t1 }- i
array( "name" => "</div></div>",( \. j3 F8 c$ x; E7 X3 |
"type" => "close",
6 }7 \6 o8 L9 C5 I, K* Z4 n ),
) p6 }$ m" _% m8 V5 Q9 C% A6 J3 O% ?. R$ f9 _5 A+ y
array( "name" => "Featured Content Slider Settings",6 b, ^( Z. E; r1 k
"type" => "heading",
7 `) h/ @& S1 I q$ s7 G0 V9 N& ? ),# [7 W; ?3 @; M+ ^1 B
$ _ t, C, ^5 a% _* X8 \2 N& A
array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>", F7 Z- Y' g1 b, y7 o
"id" => $shortname."_featured_activate",
}) d. J3 y! W "type" => "select",
' c5 w( c6 M8 f4 }+ \ "std" => "No",4 S8 A' o: M% v% x% F4 e2 V* X3 r
"options" => array("No", "Yes")),& c8 ]- V1 e! b
. c `7 v6 d2 V9 d O: {
- C( S. E0 p1 ~; O2 M& A# h7 k7 D array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
' A3 R9 O7 n: x% [4 G1 B "id" => $shortname."_featured_category",# @+ K |6 z2 R3 l& w
"type" => "select",
& Y8 i \) a; h g' {2 m "std" => "Choose a category:",
2 u7 E) r1 g( ]9 F, e "options" => $wp_getcat),; z8 q: {; P0 q$ S) {/ u0 W
- X, R. Z. a Q/ P
array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
5 V0 ~' @9 V( d/ G" c% f+ X "id" => $shortname."_featured_number",
9 k0 z+ o7 f# A' t5 Q4 V "type" => "select",
# M" e3 K a8 _6 F7 p9 i* S, M "std" => "Number of post:",0 X5 D* }2 e5 A0 }
"options" => $number_entries),
7 z2 s% i+ k/ ~8 }- T
- t2 U7 \; E A% F$ V array( "name" => "</div></div>",) G1 b* B, R0 g: ?1 N3 o; ~; c
"type" => "close",2 r2 X6 }+ E' p( J* F
),+ [) G+ c7 z5 i3 ]
+ h$ K( H3 s) x* c* ? array( "name" => "Featured Category Settings",1 [- v5 w- I' W9 |. z5 L
"type" => "heading",) v1 E |2 k% H2 h9 j
),
8 @1 j* y+ J# t' q0 t% V$ p, ?/ H" _
array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",( Z. u4 \5 L z3 ~, m* o
"id" => $shortname."_featured_category_activate",4 r3 v' B5 e& g0 a8 C
"type" => "select",
' _; A: v# B; J2 [8 J "std" => "No",) \6 y' \* |0 o n8 r
"options" => array("No", "Yes")),
7 W' |! g7 K9 u$ U' Y 0 R4 b' q5 V! P/ B/ @2 m- u6 D& k
array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
/ N. O+ b# s, [) N+ n2 d1 ^. R0 ^2 m) d' ~ "id" => $shortname."_featured_category_id1",
& \" P) ^8 L% U( G4 A& R "type" => "select",8 I" c. H9 q3 @- W# t) I
"std" => "Choose a category:",
$ o4 \6 p- j3 [6 w "options" => $wp_getcat),
" s/ b _; g$ _
* S! b7 Q/ V& p6 [ m array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",: Q+ ?: N( g" P5 m) P
"id" => $shortname."_featured_number1",1 I) Q E" A. d- h3 S/ ~7 H2 R0 h
"type" => "select",) C5 |+ v/ t' g- x% a
"std" => "Number of post:",
6 Z; C( {8 f) T/ @2 R+ w0 e6 m "options" => $number_entries),) j9 y M, l! m" K1 Z
. C% j8 ?0 g$ D- s9 Z# a
array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",2 w' h) i+ K$ S3 q" e0 l0 k/ z
"id" => $shortname."_featured_category_id2",' C3 p+ y( y1 d0 w2 B
"type" => "select",
7 g; B- L6 h t1 g "std" => "Choose a category:",/ v8 D$ z( x- f8 S! G
"options" => $wp_getcat),7 I' C* W: J4 S; L# ~0 W/ C% a/ p
% ?$ N3 m& ]% t# t4 c4 n
array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",( a' ?' O0 Z1 T% \$ X
"id" => $shortname."_featured_number2",
& |' g3 l+ g! {$ U: V! W. A "type" => "select",
, F4 Y" [6 S0 T "std" => "Number of post:",
& ]3 F0 r; ^! O1 B) G/ A, J "options" => $number_entries),
% l$ U- ]# e/ }# a$ I% K" D! p- |
, D1 v; j0 U' d
- z% j h% c% u9 H; ]+ \ array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",# O# f- i! }6 }% U" `+ c/ Q! [
"id" => $shortname."_featured_category_id3",
7 m" O4 S/ r1 P( Z "type" => "select"," q- e/ p5 |# O! @& ~# d3 C) j
"std" => "Choose a category:",
' H/ q! C3 R1 i. p. [ k "options" => $wp_getcat),+ b* { E1 O' j; h
- I0 @1 O* z. ]0 \- T, y
array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",1 v4 S) L/ I! `7 [
"id" => $shortname."_featured_number3",+ N- a) I8 @3 U6 u, B2 h3 X
"type" => "select",, D; C% q: b1 ~& x1 y
"std" => "Number of post:",
( E' K1 }) d1 K5 T, k d" i "options" => $number_entries),
5 O4 L0 Z1 A" M! z& K. F0 i
2 R) J5 O3 K5 a' k, U- n
' ^" g, ~ N f7 O2 Q/ } array( "name" => "</div></div>",
O3 R& t! a+ y- ^1 V4 H "type" => "close", Y2 X# v$ p# C5 b4 a: [
),2 U) t7 q' Q9 Z0 {) A" V* b
* F7 Z7 v: {6 y0 }: r) W) D0 B5 @7 I+ S: [, t: T) b% Z* h
array( "name" => "Google Adsense & Analytics Settings",
2 j' E: u- i# L "type" => "heading",
: o" ?1 k# w* @! v ),, Q; h( \8 ^8 M) h- z
4 @. V2 R5 ]3 E& G6 Q- A& {! z. b array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",4 E8 f6 ~6 Y0 G! H. v% V& C. b
"id" => $shortname."_adsense_loop_activate",
" R9 t a, A1 K, G& _4 [ "type" => "select",; u* k- j4 Y, T& }1 d$ v
"std" => "Disable",! j, {0 {* I. R- Q" e( ], i+ G
"options" => array("Disable", "Enable")),
9 F5 U s' v) h/ b3 D5 I) T& A
; C$ m6 L% {! {: n array( "name" => "Insert Google Adsense Code For Loops Here<br />: R" B' i+ ~/ [( f3 B3 d. M" S( |5 g
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",8 Y1 Y9 L2 u6 [) I3 m
"id" => $shortname."_adsense_loop",
/ E2 E$ @9 r9 D7 b8 [ "type" => "textarea",
# P1 ^; A' O$ g" a; O "std" => "",
7 \) e( K" A, G% N6 W ),
$ R9 R4 o7 q9 x7 T/ \
6 l2 X$ c5 P# j# k array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
. b" B; F. a4 o* K. `. ` "id" => $shortname."_adsense_single_activate",
! I# w9 Z" _ t) K "type" => "select",2 ^- a8 _" \8 k3 w" W2 s! b- l
"std" => "Disable",3 A5 o9 O) n- @" D) ^$ c" N
"options" => array("Disable", "Enable")),
. B) X6 k; y; i% X+ S
9 J8 h* \9 [" B4 p" w8 y) p array( "name" => "Insert Google Adsense Code For Single Page Here<br />
& h; J5 U0 _# b2 ]# P$ W <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
& M P' G% \: ~. J "id" => $shortname."_adsense_single",! Y1 N( Y$ t4 X4 g- K6 Q: h
"type" => "textarea",% i& a1 s! g) r0 H
"std" => "",
: B9 E/ }, o9 m5 u6 J ),
: E; S4 l, C8 N1 E! o* M% W- D, r! t8 T9 t# O% w
7 M N) _9 X7 B, \ array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
8 N/ N3 m2 m( y "id" => $shortname."_google_analytics",
% s5 |7 }1 p, F0 E "type" => "textarea",2 p5 a5 R( r& g
"std" => "",
" X& }! c( S+ d$ ^" Z0 e ),- M- s2 r$ ?$ q" t3 J) p) R0 r3 {
& Z0 u* ]" H6 d$ a
array( "name" => "</div></div>",* }8 \' V+ m& F* H+ ?/ [; r+ B
"type" => "close",7 K. D6 r& c9 N' B6 I* ?0 r |
), K7 h( N- m; a
+ C7 B/ Q6 G$ t+ E" ~
) j+ G, F) S2 T8 L# P; e
array( "name" => "AddThis Social Bookmarking Settings",
C/ J7 p; b4 u$ l# B7 b "type" => "heading",& J! x" u$ i6 g9 T
),
! ^) D' @; Z1 c; F
4 f- f8 p+ R$ g2 r array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
3 L8 ]/ y9 U4 v) z/ K8 a' {. l <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",
3 J& M1 X0 c& L0 q$ P8 Y "id" => $shortname."_addthis",
2 C F* J8 p" _; Z4 Q$ Q "type" => "text",
% l6 C! O4 E3 o% Z "box" => "social",
) Z6 H f* i# H. S5 O# ~ "std" => "",6 D. W& E( A0 L: S) F
),
5 j! s- a' ]- [/ }* L. {4 a8 J) X7 S8 O) j, a' X. A
array( "name" => "</div></div>",
1 D- {, S, l, d, O! S; V1 y3 V/ l) J "type" => "close",1 Q7 z) V% X- ?' S8 i. ^
),+ B1 c# K: l6 b8 k( S
5 ^ D) \' ]6 b2 P$ j. x
3 } ?0 s& V6 C: y 5 b# U( [( h6 _" r6 ~
array( "name" => "YouTube Video Settings",: }. K7 }/ E# i. H y5 o
"type" => "heading",6 A7 n4 w! @/ ~' N0 R8 ~/ ]
),- X* n1 U9 {. ^$ [& R! j- F1 e
5 n$ B* }; ^. k) j+ Z) s
array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
8 p) v1 K( X! l$ @' {9 w "id" => $shortname."_emvideo_activate",& A, d ~" F3 e% J' j- s
"type" => "select",
- y6 m0 |/ H2 u: B+ F8 a& Q2 F "std" => "No",: T- ~( U" X5 | y
"options" => array("No", "Yes")),) \" \; V' U5 s; w$ w
' b; g i3 G* V4 ]
array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>",
8 \* Z% s, ~! Y8 d& b; p5 G "id" => $shortname."_emvideo",( r7 }6 i4 a. p# L# Y% Y3 r) \* m
"std" => "",* u6 s2 S9 i6 V! G0 u; I: B
"type" => "text"),
9 O- q i3 d8 j6 H9 k E& P I) B- h8 a4 O" v
array( "name" => "</div></div>",5 H; B& C, R# ~* `
"type" => "close",9 @ V; M) Y+ V) y# ^4 h) `6 p- F
),
) C8 l) c9 s: K% L 2 F9 }- J6 V y8 v( G2 O' y
array( "name" => "Twitter Settings",
! C$ T U* e" [1 x. i "type" => "heading",) K# D+ ?( W. u
),, ?8 [% z0 s: U! g' ]
% P& q; y" Q, _& U( b T6 q array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
: X& m4 S# X4 q2 N. P "id" => $shortname."_twitter_activate",
$ W/ M9 w0 N" O "type" => "select",
/ _) d: z( W) e) I "std" => "No",2 K4 S* `6 Y+ L# e1 v0 B( q- c- z
"options" => array("No", "Yes")),( _! R2 z t& _ O
, J" k" X+ Y( P9 X! ^) r- n array( "name" => "Insert Your Twitter ID here' X* o- ]( V# Y, X* O$ x& R/ u3 S
<br /><em>*leave blank if not necessary</em>
) x- m/ X% C v% S, ? <br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
/ O5 R& B, Z0 N' ^! L "id" => $shortname."_twitter",
6 M/ n! n/ t* d* L. H B( \: t "type" => "text",
5 j. U1 }! l: P+ _+ l+ M "box" => "social",' t* f4 `3 v; X1 l) d) s
"std" => "",. g3 R& y" A: R! Y8 M: `, h1 O; x6 F
),5 J/ P, c1 }' V: B
* t$ G4 r+ k8 Q& M
array( "name" => "Enter Twitter Feed Count here2 \, {& a z0 Q* B( S9 y" ^6 L% Q
<br /><em>*leave blank if not necessary</em>4 z5 N0 H& A; p) i1 G4 h& L6 k
<br /><em>*Enter How Many Twitter Feed To Display</em>",
5 R3 a w8 J8 Q' O0 s# K1 u/ _# T "id" => $shortname."_twitter_count",
6 l: d/ Q! c; Y6 U& q' \) l9 o "type" => "text",
4 W% v3 h* `! ^1 r7 X0 k4 _ "box" => "social",( P' Q8 F2 Q" u+ K+ _
"std" => "",! _5 e& O9 z9 n! |- r( ]
),
$ V% f3 q4 u. ~9 b0 C1 W& z6 |7 c" H! |2 y; p" w8 f
array( "name" => "</div></div>",! F' o" R; W. u5 b
"type" => "close",/ R) y N$ \" y; o
),5 q- h# N: P6 j
# K' S# s* F# P' ]: d [4 r( I
+ O/ a/ {" u4 _/ d1 K/ ]4 Z# ^6 J
array( "name" => "125 x 125 Banners Advertisement Settings",
* P9 _% u6 x4 U0 i "type" => "heading",7 x( Z3 f5 a$ O, X a
),1 s; [$ n; Y7 ?* |- f9 `4 P' E4 B
+ T% Q" O8 z6 I! }* m4 \ array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
6 N/ ~" _! B/ C! {0 D "id" => $shortname."_sponsor_activate",
6 Z) x! f t9 ^ "type" => "select",- M3 P' ]: [* S* t
"std" => "No",/ C- d5 L, o3 d9 d3 ^4 u
"options" => array("No", "Yes")),
6 `4 e3 }$ G1 @& O0 y% @) l+ D6 J
t; L( v# u; U7 P, x
7 j+ \6 V0 y$ d array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",! \. L( E5 ]' ~4 B9 s+ n
"id" => $shortname."_sponsor_banner_one",3 z( o5 J! e/ n3 K
"type" => "textarea", }1 {, j& [, Z) E# r, V$ |
"std" => "", v( y& g5 i8 \
), 5 d0 P1 c: s7 m c2 {2 k7 [$ Q
6 ]6 i! w- K& I0 o. c- ^0 n array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",. ?( R, k/ e( g
"id" => $shortname."_sponsor_banner_two"," c6 z4 i& M1 Y! Q, E0 I" F
"type" => "textarea",& L* q0 p& Y; c
"std" => "",6 V8 U5 j2 Z, S
),
6 o/ ?0 Q/ s( G& v1 n& Y
* G& D1 Q- Y, x$ D/ S array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
% o) K E+ j% W2 J1 @% y7 _$ l. d "id" => $shortname."_sponsor_banner_three",
% ~) K* c+ h# p/ b4 ? "type" => "textarea",
5 g n2 u7 }! P4 l "std" => "",
. ]; H' v3 V8 T& L ),
+ o% w `3 N ]# U. N1 y7 z3 H0 R* q" h- B/ D7 J1 l: M
array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>", e- N% w) }& k' _- g
"id" => $shortname."_sponsor_banner_four",0 |) U& u5 T& D, C& e
"type" => "textarea",; T+ {. r7 h O* K- Y# a" E& j
"std" => "",. w7 n: i& h) \: T
),1 B; F$ n8 u: N
1 p: Q: k* }) J8 q
array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",8 Z; ~# s9 r9 R% X! A6 L, r6 L2 J* s& d
"id" => $shortname."_sponsor_banner_five",2 O$ k8 \2 K d/ e* I7 q
"type" => "textarea",
5 f$ H" k2 e3 N- R# ?9 b3 I, E" x "std" => "",1 m1 U, w+ s$ h5 S" {
),# l" E3 b1 P* e6 l: w
: R4 f' ]8 [ [8 W array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
, _4 s' L3 ]$ s' t+ o2 O+ J( b5 V "id" => $shortname."_sponsor_banner_six",
: z2 h5 k7 X* h0 {8 z% \9 u8 S "type" => "textarea",9 i, S3 U9 L) E' K, K! n) S- E; J
"std" => "",+ Z, w6 z! r( j4 d# P& Z
),/ [6 ] N7 B% u) P" }% Q+ s0 C
/ ?1 Q& | O5 l; I3 S, R% P array( "name" => "</div></div>",
1 ? e3 W/ o% R0 G1 i2 W "type" => "close",6 P8 O# b# l; ^/ T5 g# V
),
) g! E: J) n2 e _4 a+ y, P$ ?& M2 A2 \7 X
: v1 ]4 e% E% k8 S! h
. F8 e6 f, {" L; v);
' I7 h+ k* X* D& V7 p; W7 S5 j
( w) O, O. E4 Q( q3 Z5 ifunction mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {8 r' `# k D# ^) k5 y" y
3 p/ [+ [8 q; M/ C; |' N3 h$ m( e/ Oecho "<div id=\"admin-options\"> ";
6 {5 @0 u3 d5 J' \- R: Q
8 Q' D, m; m) @global $themename, $shortname, $options; N8 v8 V6 ]' ]' s: e
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';
1 x" T& U8 F( c. Q! {6 W/ kif ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';# z/ l* f& x; h0 R& S+ r v j: e
?># I! C; k. g$ E6 y. T2 u& R! g5 a
- j! _& E2 A; Y) j5 }
<h4><?php echo "$themename"; ?> Theme Options</h4>5 n% Y* q$ \. S" F5 u' e
! Q4 N$ A! z$ ^# N9 }& J
<div class="annouce">
- j p5 G' F5 g3 a+ N: _<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>
$ j" o l' Z+ W0 C( R. w T6 X<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p>
1 B% T4 ]; i# v6 [# h" S- D9 h</div>
! J" j1 g. a( u1 l( t f3 l/ X) ^* S1 _4 g, w! M2 c0 t
<form action="" method="post">- \5 D; `5 X/ n7 `5 w0 d
2 S" a+ ^; \3 {1 A5 D' m% U( T
<?php foreach ($options as $value) { ?>6 N4 B8 y7 {' E1 m9 o1 |
% s4 l, z _; f; B" a E
<?php switch ( $value['type'] ) { case 'heading': ?>
5 O% c, o* N( V) d2 E/ ]3 ^& T1 M6 D6 d/ C3 I& Y
<div class="get-option">6 J8 I9 d3 y0 ~
, R0 ?* |/ a* d6 m/ _
<h2><?php echo $value['name']; ?></h2>" B$ U! e" u+ Z# |% d
! O! N& e8 R7 }$ p |<div class="option-save">
1 n D% M3 e, ~6 j3 P+ f) ?. e9 E
<?php$ t) v, {# [$ c# X# ~/ b
break;/ C" `' P7 M, r) ~" p2 B! n
case 'text':
# k5 C1 O! i! i0 h4 k?># D M* r1 r% P8 `$ U1 M
" d# k2 O- D2 d$ y6 c
<div class="description"><?php echo $value['name']; ?></div>* S. W- ]2 ^* w6 V/ o7 v
<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (7 n+ {6 Z1 ?2 H
# G' B& ^! I5 G3 G& d; q& }! ?) R! |
get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>0 f( z) B8 {) R1 k
6 { ?6 F+ m7 t3 u4 d6 m- S @! f<?php( F# Y( {( v# t3 I
break;
4 k+ X a4 c5 X3 }case 'select':1 e; P6 ~3 n& U# I* P5 L* K* s
?>
8 V C w6 |* O
+ u( Y8 s7 i& |. H& G5 `, n<div class="description"><?php echo $value['name']; ?></div>7 m1 @: u$ p9 p' k* E& m( f
<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">
( Z; Q2 V5 r" o% c5 d$ l<?php foreach ($value['options'] as $option) { ?>: \& U' ]' N; k: o8 T; } J
<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>/ f m5 Y6 k1 K* T
<?php } ?>8 M* a# d$ Q* v
</select>
: y( S9 n7 j- l" ^7 t* z. E/ J</p>
* O1 h% c* K7 ?% G/ o
2 j9 Y7 I3 g, u7 s+ N<?php8 C$ {' y3 D1 T3 W- N, Y
break;$ S; M8 s6 C* m1 E7 O' S
case 'textarea':
8 L8 \9 s2 d! {. F$valuex = $value['id'];
( a! h6 g7 S1 }" _6 Z* ^4 j$valuey = stripslashes($valuex);
. @; x3 D/ V" \& ?+ e3 v, m* e$video_code = get_settings($valuey);, Y1 W3 H& r6 e2 H/ C# G; H
?>
, J5 s- T$ h; Y: G2 g
+ K+ _9 A Q2 F- T3 t<div class="description"><?php echo $value['name']; ?></div>
- t, }. n; a6 I<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
& E" z' w" r" S* @$ d/ [7 N+ a$ w, [$ h7 O0 B1 n8 j, d# ~ {
else { echo $value['std']; } ?></textarea></p>
5 Z: h$ |' f$ m% i3 |- H. {0 x; p. l5 K
<?php
; s" S/ h" H# u2 N+ H, Hbreak;
5 I3 Y" W! B" b8 Y4 {6 Q! G9 B) hcase 'close':
C7 t0 L7 g: h; ~) t6 ~?>& k; D: f! D4 k6 W
& T2 o! Z1 X- g# `* g% ^- I/ |<div class="clearfix"></div>
X& e0 F; L' e/ M</div><!-- OPTION SAVE END -->! K5 v2 q6 n0 I6 N' p+ w
4 ^+ i- l# @ a& \% g* f F<div class="clearfix"></div>
) G9 T b( R1 r; n! X' m" N2 x9 k5 d</div><!-- GET OPTION END -->
+ a+ T1 b9 O& H9 v; O4 I$ P
( Y* q; C9 b6 l4 D5 Y<?php
) Z/ a I# Y S G W& A) X! gbreak;; v% b0 q) O- @2 a8 B
default;
. B+ C; F- p( Z1 @% A8 C* v?>
* K2 h) e3 q( |
, d1 s/ F/ h6 j J* q) F* s8 x4 H
) v+ E2 h& A, M( D/ j& T( {. ?<?php2 g( x; ]" g+ |$ W* d3 ~5 ^
break; } ?>9 V7 g3 U* a1 c' s5 W8 ?! G( U+ C# h5 S
9 Y1 ~( G2 h, u: w1 S/ i
<?php } ?>
( S. a* }; g m) x' {% [! @. g5 p5 r1 c) {! ]
<p class="save-p">+ q H( o( v) o/ O3 O9 U% r
<input name="save" type="submit" class="sbutton" value="Save Options" />
: y2 O4 H0 X* l# ?8 E<input type="hidden" name="action" value="save" />
6 G0 f! G1 x( ?* ~% l</p>5 D' J; Z3 u' b
</form>/ f2 [( H" I; I5 ]; w) d/ S
* \1 ^% B* |9 O<form method="post">! u) j" r! Y$ b2 i1 C3 Z
<p class="save-p">/ H: H$ L8 V& m) L% o* |- u
<input name="reset" type="submit" class="sbutton" value="Reset Options" />
8 C) p, G( d# U. K# }- d<input type="hidden" name="action" value="reset" />& Q6 A$ d, j6 x g8 d* C2 ^" |1 J* V
</p>
8 E+ v) a1 p% l</form>* m* Y9 |$ Y4 D, z6 O2 _+ z. d
* \+ F7 [0 M9 B8 z
</div><!-- ADMIN OPTIONS END -->* g0 Y4 R; D9 Z
2 k2 n. J, Y# j8 }5 G! O<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
R" k& r3 O/ Q: \7 f7 ?, w1 S
5 k6 ?- \4 [9 ?. ]1 O; @7 L$ Dfunction mytheme_admin_register() {7 ~' @( K6 b; k' h
global $themename, $shortname, $options;# y. D( \" l5 i
if ( $_GET['page'] == basename(__FILE__) ) {% H7 Q; e7 j4 G9 e8 B
if ( 'save' == $_REQUEST['action'] ) {
! O. }6 _9 r/ C2 sforeach ($options as $value) {1 K2 v' y [6 v% G3 b
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
$ Y( g3 R; G4 oforeach ($options as $value) {
/ D* ?9 n5 S& X: T# [. R9 s$ q# aif( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }0 k5 {+ ]/ B# L
header("Location: themes.php?page=functions.php&saved=true");
0 L8 Z+ T7 l% ^5 L, J( }& T: z3 g/ R+ qdie;
; ]* Y5 _* \2 @7 b1 O+ F} else if( 'reset' == $_REQUEST['action'] ) {% K/ @3 u2 d ]% W l- _7 t1 w k
foreach ($options as $value) {( @+ B9 q7 k7 A$ U3 B/ w
delete_option( $value['id'] ); }
: ~( `1 i: ~. A! Y: S! P. g+ Jheader("Location: themes.php?page=functions.php&reset=true");
2 D' j0 y; O3 s; v! Vdie;
, O3 C# Q6 l( V" s8 D}
1 S9 K' k% s- \2 H9 a# s, `! x+ b0 e}
) D9 |* T* U! \/ A- tadd_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
0 E4 j. d A4 s6 @+ f1 Z. m}
4 A, i, A: v) l u
! y9 e- \6 u. U! L0 T5 | j- gfunction mytheme_admin_head() { ?>% r* G. \& t" i3 _) t: B
<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />
* i6 O; w$ _, U7 a( ^: L" K<?php }
; {$ z6 S( |( \+ E: O# y9 q |
|