|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
! N* q4 G# N; V2 j+ a/ f& r// Theme Option3 F5 J4 Q$ R5 N5 b Z* F8 I7 h
////////////////////////////////////////////////////////////////////////////////
- @0 O8 ^; C/ o) Y- k3 y; J3 z- ]8 ~5 O
$themename = "Zenx";. q' @% t! T& A2 k
$shortname = str_replace(' ', '_', strtolower($themename)); g8 G- J, v- C4 l+ ^: `
2 |$ M& K. Z3 {2 N' u( M2 W1 T8 P
function get_theme_option($option)
T& J$ \. r- N- r2 G! ~{7 w5 E( \* K) n/ p/ Q
global $shortname;. q9 ~8 {' k B4 w+ w
return stripslashes(get_option($shortname . '_' . $option));& Z% {2 g6 R0 u* m
}
4 R& h8 X& V+ T# Z/ @( D' t: o5 t: {* @* v4 }* o6 K, q) o
function get_theme_settings($option)
" U3 c6 w+ D& Q0 ?$ w; h{
! f% }4 n, Y2 [- O- v return stripslashes(get_option($option));
7 A6 Y' q7 a d5 W}
6 L# \8 b5 L7 n/ z: V1 k" S$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");3 m6 H$ B2 b' P7 s2 z0 Q
$wp_getcat = array();3 O! u8 \2 u# s; A3 j
foreach ($wp_dropdown_rd_admin as $category_list) {6 c0 i. j$ \1 e f
$wp_getcat[$category_list->term_id] = $category_list->name;. \. L. r s# {+ o6 V h& S. A
}- d0 W. {$ |2 G1 ~" H! o& B
$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");$ `4 e$ _# z5 U; x
$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
( K$ J( k; Z# c" G. i$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");
4 Z- T* s, @$ [/ e' i4 t2 j& K# Q' ]( ?! X& ]2 F, T. e
$options = array (6 j9 S4 ~' t+ u' c# G+ u* {+ X: b
, \7 p+ b; p/ s6 w, m% U& z
) j! E" O1 Q# X# X1 W* n4 c
array( "name" => "Blog Header Settings",' e3 L& K' ]$ ^
"type" => "heading",
8 W% i6 P4 n4 d& z ),
- y8 r* Z# Z" C- w' ?
6 q) n9 q/ q3 \: x; B7 T; A" z array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
2 K2 a. s; e# ?/ I9 l "id" => $shortname."_header_logo_activate",9 |! i& g5 t7 @4 S: K; E. c
"type" => "select",
+ U; R8 ~. s: O, ? "std" => "No",0 h+ l) ]' m% f
"options" => array("No", "Yes")),
, `$ |" R! j n4 r$ Y4 F5 ^) Y% j; h# A) Z' E d
array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",1 d% n7 [# a) Y2 m z% u7 \6 z' e
"id" => $shortname."_logo_url",
! M8 x- w& J; g3 _' H/ o- c/ F5 d "type" => "text",5 B- B1 [/ ~: h! b1 Y
"box" => "social",
; M4 L6 O4 d4 ^7 `* r, V. u "std" => "",- a( P* m0 f5 Y0 m8 ]3 q& h
),
- t1 b1 u! ?5 m$ x$ \( ^6 H 1 d- R/ e. \) p5 a8 v j5 A
array( "name" => "Insert Header Banner HTML Code (Header)
3 R: F9 e( ~! W# W3 T8 K6 {# y <br /><em>*Recommended Size 468 x 60</em>
9 \" a, L; o' N6 ^% W <br /><em>*leave blank if not use</em>",/ ?9 |5 y" b# d( [9 n. \) H
"id" => $shortname."_header_banner",
' l% b/ A" T# z7 a! K "type" => "textarea",4 R0 U% w& D# F7 E/ W' e
"std" => "",$ E) i' o$ C- H3 W$ k% N; g
),% ?& i. j% Y' E. H( i$ T
" }; B6 m) b3 { f: d( I
array( "name" => "</div></div>",
. N- ~$ w& P& @' `" s "type" => "close",% A# Q. f) Z( N8 m0 S2 T0 i. W$ Z. }
),/ v# U) Z8 D( h
" I, {! F( J8 _7 |1 T
* |& p1 M) U( e2 ^7 |
array( "name" => "Header Navigation Settings",2 W. u* S: G1 P( j
"type" => "heading",
. L9 ?' D' S; O6 j) a ),
( S+ q; Z- A, O9 B" }. g
# F" m* g5 {. ]3 m* I: I. L% _4 ^; P array( "name" => "Insert Page ID To Exclude On Header Navigation<br />
9 A3 ?, H$ @8 q" A. S4 h8 v. [0 s <em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />& U9 D: ~$ a. G& C0 b) Q- h( Q
<em>*Enter the page post ID number only</em><br />7 y* H2 K$ L- u! O1 Y- q
<em>*separate by comma</em><br />
9 E3 c8 H) o, f <em>*Exclude pages which you don't want to show on the header navigation</em>",1 b' w/ H, E7 @* @+ M
"id" => $shortname."_header_page_navigation",
! R4 x3 P' C; l4 l* C, s2 F "type" => "text",7 S2 N% S: F, c$ u; U& L& z8 Q5 O
"std" => "",$ R1 i1 C+ p# o7 O
),
( X* h/ b4 g& \! l* Y4 I) A. M9 M
array( "name" => "</div></div>",
Z# [6 `, R8 x! L "type" => "close",
& T" o o5 E1 Y5 H: \! } ),
% q4 R) q, [0 r' f 4 H/ q- \8 s7 C6 j" F0 x
2 R+ v0 `" F$ O( @9 C; J
array( "name" => "Post Auto Thumbnails Settings",( Q* J1 u! m! C$ p. b$ B
"type" => "heading"," u9 L- R( M! p5 X, M
),0 b( y- K* N) e% q R% ]5 ]4 r5 b
6 r# K, Q$ x% S2 m |7 J array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
& B$ o' y `* j6 r( w2 N: p9 h7 B "id" => $shortname."_timthumb_activate",/ J* l6 o3 j: W! N& y
"type" => "select",
P& d' p/ A! }0 K/ \- m "std" => "No",) _' l2 O ?# _% D& ?: @) M
"options" => array("No", "Yes")),
: u @9 |! {0 L0 g+ w5 P
: V1 n4 _. d' A7 x! ^ array( "name" => "If Timthumb is enabled, Please choose its cropping method",
' }( C7 T4 a( V "id" => $shortname."_timthumb_cropping",3 d: X% u* C* B5 S# y* [' M
"type" => "select",
) H$ K1 U" I- ?2 f) j. ^ "std" => "",9 E: ~9 R- x* a0 U+ ^
"options" => $crop_position),* R+ x e( G v$ r7 J9 e$ l- z
/ B8 _5 N; r" [ array( "name" => "Insert Width Of Thumbnail Image<br />
4 l+ ^) Q: y' G) {6 }, Y, Y <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />' C2 ?: D, A0 \1 t' B
<em>*Leave Blank To Use Default: 250</em><br />",
% Q' L* g- y: t9 F8 @" t "id" => $shortname."_thumb_width",9 [* c- j; ?' \+ Y% l
"type" => "text",3 e+ w) D# I' L
"std" => "",. }9 |) c8 j" O
),- r2 E& V2 X) R9 g
7 H# m9 g8 G& U8 Y! B/ R. h
array( "name" => "Insert Height Of Thumbnail Image<br />
: |1 j( k! r; {" ~0 N! [' O <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
/ |, w" d2 M6 C# Q <em>*Leave Blank To Use Default: 200</em><br />",/ [$ P/ ]: m# j5 g
"id" => $shortname."_thumb_height",
) W" C, w- \2 |) W% | "type" => "text",
" t, R; q4 `2 o4 H& y) B) O "std" => "",
( I) O5 ?0 i; G' A5 G5 E* @2 m5 h ),
. V5 `4 p* b6 d2 N2 M# S
# Q* G! K. I' Z array( "name" => "</div></div>",2 E5 L9 }. B. f
"type" => "close",
h6 i) t0 S. s4 \4 J/ V( S ),( s. j1 H1 c( _, j$ s* r
5 q) V- k9 _7 Z( J3 X; s; d
array( "name" => "Featured Content Slider Settings",% x8 }/ U! j: y5 ^9 L
"type" => "heading",4 {- z' O7 [1 P$ n
)," x; Z0 c3 W& R/ [0 p# i
& L* ~4 Z- y1 ^2 x0 a! x array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
6 g, E9 t$ J9 ?% O! n "id" => $shortname."_featured_activate",
* ~/ L" N) G8 f1 N: z4 `/ ]% b "type" => "select"," S' P- \( B, q1 \9 q
"std" => "No",
4 L7 c8 l$ ~$ D: o( n' E _; @ "options" => array("No", "Yes"))," {; x, h* X9 ?/ L$ K: [/ K) a
$ G6 v" I: i4 ]# J4 I% K2 r: K( l# c2 W% Y* L1 b
array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",1 {0 g/ f) l B6 ^( I/ E
"id" => $shortname."_featured_category",
+ V; }' Q" q3 ~$ x "type" => "select",; v. _5 ^+ b6 p; a3 f
"std" => "Choose a category:",
5 E1 H) |) S$ ^7 P "options" => $wp_getcat),
& ^# [% m6 A/ r9 [$ k% x9 K/ k6 p9 c0 {# N
array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",& l: s- t' B/ c$ ~9 l9 s
"id" => $shortname."_featured_number",7 F8 O. y1 [& y5 M
"type" => "select",) T2 j( P* d+ B" n
"std" => "Number of post:",/ ^0 U7 P3 R, d E Z- K; \2 m
"options" => $number_entries),
& p2 |1 q8 ^. _ A! v1 ]# s
# ^3 X! P$ P+ c0 D; D, l array( "name" => "</div></div>",
5 I' I9 L, v/ H2 E! }& c7 } "type" => "close",+ w7 ^! |$ |+ v" n( I
),! i- ~; j% j. ?6 _; o
: B# {: g6 [; _, m, d: i array( "name" => "Featured Category Settings",
$ g& y' P- o7 Z- n' o7 E8 J7 R "type" => "heading",* B& e7 a, |) _) D3 A
),
( r6 ]; V! j9 n3 y! T! ?2 D+ O6 h& D% y5 B# m1 e8 w: a9 ?$ q; O
array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
6 E. v5 }$ Y2 N. Q I; {) b. ^ "id" => $shortname."_featured_category_activate",1 Z5 R0 K/ F$ G! y2 [# r3 K
"type" => "select",' m% K9 P, [8 b" z2 x' ?4 [: o3 H
"std" => "No",
1 Y8 `) a) l: |/ `3 G* l' g$ W: d "options" => array("No", "Yes")),2 b) d7 @" ?6 H3 H9 \1 w
1 F# R* G$ q4 P/ a8 D' I: B array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",8 c' ?( R1 x: O
"id" => $shortname."_featured_category_id1",7 i; |$ p: }& Z7 B G
"type" => "select",
$ q% A* R& M' l1 h+ E "std" => "Choose a category:",
+ K/ \- P6 k/ i "options" => $wp_getcat),1 X& ], O' V4 P# C
& i c: H1 K* R array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",9 O. i7 a+ |! h) E- P$ E9 d
"id" => $shortname."_featured_number1",
2 Y9 w8 u( L# @0 ]. p "type" => "select",* `2 L5 g, ?, t. z5 d
"std" => "Number of post:",, X2 k9 Y" K# h% _( M
"options" => $number_entries),
4 Q M! M# F7 \8 o4 r C; j: ]6 d
1 N& O# g$ Z' t, c" L6 j array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",7 W: x4 Q3 ?2 l: q" X4 A
"id" => $shortname."_featured_category_id2",
' @; G) l/ c1 o4 `: b "type" => "select",
7 H, f/ O, Y; S9 R) D: v "std" => "Choose a category:",$ v' P5 |+ s5 s
"options" => $wp_getcat),+ Y8 o6 `% k* t6 ~4 ]7 l4 l" x
& s6 c9 U) n7 O) G array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",: `# o. \. Z/ _$ j( ^3 A
"id" => $shortname."_featured_number2"," T2 [6 y$ e8 S0 P, v+ i
"type" => "select",: C3 {5 P( w4 }2 B, ]
"std" => "Number of post:",( R2 h/ L$ m+ t0 \; e# Z
"options" => $number_entries),+ T5 Y) X7 E) L7 |5 N
s: o. q9 f" |2 y
# i0 w W( \ N( D6 p7 h8 Y array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
d, B0 o2 v4 {* u "id" => $shortname."_featured_category_id3",
% z9 c+ ~* v( s0 j& G, N1 k# u1 w "type" => "select",
( s& ] x* {; F( Y" f9 f! y1 Q" I9 J "std" => "Choose a category:",% I. O+ I4 k" q1 i
"options" => $wp_getcat),, A1 j2 E9 \# S# T( x
; e6 g' Y- W6 Y9 J$ e$ C array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
6 q K* l, G% K0 y/ p* q "id" => $shortname."_featured_number3",0 X4 a# b! v- B! C& n0 F
"type" => "select",
. ?/ t! h8 {6 [; K l "std" => "Number of post:",
9 X+ a& X, ], I6 s; K2 } "options" => $number_entries),
7 u( F1 d( D! @! h e' \6 G& ]+ D1 b6 E4 t
+ [! d/ ]" X* Q% h, a- j' ^
array( "name" => "</div></div>",5 O$ M# s, K/ L' ]$ e* @( s
"type" => "close",
0 n# ~( C1 g! d+ e ),
/ d! Z7 G* v( Y, Q
/ b h7 F( ?8 P" }
8 ^$ b" N* f J$ D1 g array( "name" => "Google Adsense & Analytics Settings",
" G; A0 G9 m7 t( ~4 t1 S6 w4 K "type" => "heading",
! Z# U$ r) R& A ),( p' i# m8 r/ e* r$ [& B
- N+ T/ w5 ^2 N% R
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",
, r& X; t; ] y m0 a8 f "id" => $shortname."_adsense_loop_activate",0 i! `+ |$ \+ C! K4 b
"type" => "select",
& v# m& D5 ?$ i& V! b- n) y "std" => "Disable",
( f2 ?& U, o5 F' p# I; J "options" => array("Disable", "Enable")),* k* l4 V" _ C; q* t( N% `$ m: V
) k+ {7 W; X2 r y0 N O
array( "name" => "Insert Google Adsense Code For Loops Here<br />3 `- m8 i: w3 T' f$ @. ^( C2 W
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
1 N; S- J2 X" U5 T; W( p& ~& c "id" => $shortname."_adsense_loop",
) r& a. x1 E' O/ c2 x% _" f "type" => "textarea",
0 c# T. W" m( l* s1 k5 u "std" => "",8 _# J( O: S" `/ J7 A3 M$ M
),
4 G6 i( K/ `1 C7 e8 M! {. d
7 B/ K; ^+ L& |' Z+ I) n( l, C4 T array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",$ b( W+ j& O, r
"id" => $shortname."_adsense_single_activate",# H0 E- z* A" w+ ^, Q
"type" => "select",
' d" ~0 x* ?! T1 Y# { "std" => "Disable",$ G- _9 d4 f) e# |% l) T4 d2 q
"options" => array("Disable", "Enable")),- F$ k& X6 X) U2 ~
/ W4 ]! j' H1 z [1 ? array( "name" => "Insert Google Adsense Code For Single Page Here<br />2 ~/ |& N( [/ G% a7 N
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",7 o! p S& F1 |
"id" => $shortname."_adsense_single",' K/ p0 }5 T( X( y
"type" => "textarea",
8 v, `, D) E1 z% U ^ "std" => "",
* \. U2 X9 ?7 Z7 Z! |2 L# B ),& Z, a3 k3 J5 o+ O
! x2 U3 ^0 R% K8 I. p
2 e, [7 Q; _ T; Q array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",9 A6 B Z* h3 k5 p
"id" => $shortname."_google_analytics",
; U2 R$ k# F z; |6 \7 Z3 I "type" => "textarea",
; u7 K# I/ c9 u9 B "std" => "",
; p0 ~. n0 l& Q6 t& L7 m" h ),
: \- @' u; b4 W [" [3 _8 t# ?2 r/ }8 y1 y
array( "name" => "</div></div>",- _7 v" Y, K8 F5 b ~& T+ h* P2 m
"type" => "close",4 _! b6 O+ W2 ]: i/ j& P
),6 p4 h( L1 G( q$ C$ L, w
1 S4 X; H# M0 D0 x- x2 c! B
6 t, [: c9 } V) ~ array( "name" => "AddThis Social Bookmarking Settings",
* t" R" h3 N8 M w% P# e) x' O2 ~ "type" => "heading",
9 u" l+ H, U) S2 g# M9 M7 Q& ]+ n ),
; b+ G3 X" I' Z8 G' m" z( r5 S4 Z6 S! `2 W/ `/ M
array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
2 s+ q. {! H3 B, q- m1 w <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",
, n8 i9 c& J: Q# \; I "id" => $shortname."_addthis",! f( ^9 a2 z5 ^% I; _2 D% ~
"type" => "text",3 W* z0 b. _( x" L: U$ l! K
"box" => "social",/ e; y0 }3 K; |0 w4 }
"std" => "",. K: b5 V) O, |' W
),. c/ k+ P0 c+ y ^
: H a0 g9 M" k array( "name" => "</div></div>",
5 N+ V7 @: Y! [, G/ ` "type" => "close",1 K8 C' J: _4 b2 O
),
* O u) i1 |, Q/ _
3 w, X; i% X* W% I. E
P, ~- G1 z) e! Z& X . x6 I8 D! [5 E4 ?0 }$ X9 N0 y. i5 F
array( "name" => "YouTube Video Settings",
" L3 V% ~( s+ z# @0 w4 f2 G0 R0 ^/ @ "type" => "heading",& M& @, S( O5 t' R4 m9 v
),3 H8 m+ t% T8 I1 B9 u/ U2 K
- f" p- z/ Y( Y+ d array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",; _) c ?1 j9 z* K0 o) ~& L
"id" => $shortname."_emvideo_activate",8 L1 L6 H& f" w1 ~1 g4 ^. k ^2 {0 Q# ]
"type" => "select",7 T) B$ U4 R9 J5 d. `
"std" => "No",
4 H( Q0 R3 u3 q! y" N "options" => array("No", "Yes")),% q/ T: B8 K- Z) e% T& p7 v# r
) k$ O; E/ `: _& f
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>",
: o( s. b/ C, v+ |! C "id" => $shortname."_emvideo",+ h3 ^: h- v9 Z' A" r
"std" => "",( n/ W1 b! S" M' f- h
"type" => "text"),
4 N C6 P0 h9 P7 @% {2 i9 p& D
8 x# m+ R3 t+ b array( "name" => "</div></div>",
3 h) g4 M1 a( ? "type" => "close",
0 `9 Q) w5 Q, x4 [- H# e ),
* E3 b9 n; n& u5 r$ o % T* G' v& X4 u* q7 L
array( "name" => "Twitter Settings",6 b: M5 M+ W& i* `2 @$ g
"type" => "heading",2 ~. ^( S# X$ R6 F" {6 L- z
),, C* j( f+ N* T6 L3 o# L
; E0 I& |+ Q! ^( `& J8 Z- `3 m7 u array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
7 d. ?" ^* T2 P! d- x; t "id" => $shortname."_twitter_activate",
6 W4 R( \. a8 R& C6 Z% ?; a "type" => "select", J9 @, ~" E/ [; F5 R/ A
"std" => "No",
; H0 o/ U7 B5 d+ o6 t# @9 M6 }( i( V "options" => array("No", "Yes"))," g" P' O/ F& a- q% ]: u
4 {, e' e$ Z0 c- W; G& F
array( "name" => "Insert Your Twitter ID here
. n1 C" ]; Q" S4 ?/ B" A1 q6 J <br /><em>*leave blank if not necessary</em>9 f+ ]+ X7 i7 q+ ^( [
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>"," S6 g8 T$ q' F8 X$ A: d+ `3 ~8 `
"id" => $shortname."_twitter",
4 `6 F. y3 I4 s2 W4 C# M; t "type" => "text",
- v \% q0 q, X! ~% z9 G2 n "box" => "social",: \* y+ w) f2 ], F$ r: L# [/ W
"std" => "",
6 ]: s# H: I) b9 h& }- ]3 I ),6 D! F; G( o# S2 C+ l8 l% e8 ^. G
$ C! \4 Z# ?* ?8 V array( "name" => "Enter Twitter Feed Count here( a. D1 R6 e( V% ]/ {# \( w
<br /><em>*leave blank if not necessary</em>1 V+ R: Y. C* N
<br /><em>*Enter How Many Twitter Feed To Display</em>",
' ^% z" p5 D- @. k! i! w+ X. ` "id" => $shortname."_twitter_count",
; `: i" K0 h% f' x' O "type" => "text",! ?; P& b# v5 V* t7 V( W
"box" => "social",
% \' m6 g) q7 v9 a3 S "std" => "",
; A! W6 @0 T5 O* M7 Y ),3 W( D4 p: d7 v2 D& E
: W% ]; w# @( r+ `0 u/ }& S
array( "name" => "</div></div>",
2 a) c4 n. e: O7 g; K5 G "type" => "close",! [/ S. D3 y; b% H1 {; v9 m
)," ^5 H0 `/ \0 a! F! x( | S
; x# ?# O0 K- N8 z! T, F4 H. [" u' r& Z. X3 }, f( J! d
array( "name" => "125 x 125 Banners Advertisement Settings",& O; M" r" X1 S h: |0 N$ D9 l
"type" => "heading",8 |! l4 X8 i6 a: t+ v" V/ x
), s1 I5 y9 k8 \% e4 V% A
) k, }$ {- X2 L array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",$ {) S7 U2 T0 J1 y
"id" => $shortname."_sponsor_activate",0 e2 s# O- q( a: V- w \
"type" => "select",& X; G( o7 W" Z
"std" => "No",- x. d9 Q# J) U+ n& ?) f8 A' T
"options" => array("No", "Yes")),
( w& D* E: G% P9 `+ [ X- z- g6 g# `+ K' v0 S# ], x* D
9 x0 [; p* u, B; R
array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",& ~( V' m; |6 l- J! Q
"id" => $shortname."_sponsor_banner_one",
% s; \9 O; u6 Q- c3 n9 z q "type" => "textarea",+ P+ @& k e* e' g- R
"std" => "",$ B/ F$ t* I5 \+ z) h2 ?+ z: ]
), 7 a: |! ~! [% e) m4 c: R
( Q; y& ?% D6 |$ ?( ~
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",5 P) x) J7 q+ w4 I/ ^, M
"id" => $shortname."_sponsor_banner_two",
2 I3 n+ k) y/ O0 n "type" => "textarea",0 I: j& a3 A( L# K1 m5 b9 `
"std" => "",; H2 f7 {( r& A! z8 F' O; I
),
: D8 G) p& M( O7 j4 o% N* P+ y3 p, w
array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
& {7 |1 m7 v8 [ "id" => $shortname."_sponsor_banner_three",/ L. ^$ T* x; z" O7 m6 m1 Y
"type" => "textarea",, y, A) [$ o% l! R
"std" => "",0 y+ m' U: A, x# C1 ^ F3 c
),* N6 H- A. H& g- o+ J: T% r! M$ {
0 r9 V4 ?# \- h+ U array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",8 ?4 C- @% N( i! j6 x# H" Z5 [+ n' Z
"id" => $shortname."_sponsor_banner_four",
' @: [- Q7 T* f; q/ T L "type" => "textarea",
( D1 \7 b& S$ T% S+ S "std" => ""," j* C# G' _! O; k* x" ^
),
* D" B5 R9 N9 ]& r Z" Q4 S7 d0 o, |) [' `% {
array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",% |' T3 b' U, ]- k& v( V; e
"id" => $shortname."_sponsor_banner_five",. \ q4 @. D! w, Y
"type" => "textarea",
@2 d" p; Z! C/ w "std" => "",4 I8 D" b& I" [$ u4 m5 T2 T2 T
),/ [+ U2 ~ Y2 V3 k; n" v
/ {* n( B9 p$ m3 l array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",2 N% G, q3 R7 O
"id" => $shortname."_sponsor_banner_six",
w- b; x' ]; b "type" => "textarea",
8 p: b! Z3 l( l2 n" a "std" => "",& l$ A8 w9 i) f
),
u2 a1 U3 W4 j# @; Y( b; w
; F+ p) ^, j4 R- |$ c$ M, d array( "name" => "</div></div>",' t% o) ]; d; u9 ]6 P: k# `
"type" => "close",6 _$ X; G( D+ y$ a9 ~
),
# ^5 {0 l; a6 H. ^9 ^) d3 }6 ~- D1 y0 Q+ b6 u" @; Z3 w
# h* u+ {; H! g# L4 H5 P: b8 p7 i( k" _
);9 i+ s A) V3 w' X0 N* o
+ F$ p" F1 J& t0 \
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {% H4 K5 U$ M5 f& d0 d
* U7 m( o" [& V& i2 F. i# Lecho "<div id=\"admin-options\"> ";
\% Z6 v4 H& R2 N; i" s
8 o5 w9 F' a( sglobal $themename, $shortname, $options;
% e- Q6 O! c; ^% g& j: cif ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';6 i8 t$ w# R V. i3 _
if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';
4 M% s9 X9 u& R0 ~' Q& \5 l?>
8 x) h( k; @0 v, i5 h5 g7 [6 ^; t
<h4><?php echo "$themename"; ?> Theme Options</h4>, I1 B' \/ {1 b
# k" a' c! [7 l0 f<div class="annouce">
7 S( J8 l8 S7 l- T$ Y5 l<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1># ^3 [9 J5 ^; q; w8 X$ ]7 ]
<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>. C& I- V6 q) A [0 Y5 W: e3 }
</div>
8 G5 V6 ~! a/ ]) e; N$ y' F
N" v/ {/ h# \+ q& d+ o, E7 |<form action="" method="post">
Q6 o/ o) i" Y
! @; D3 l& ~% }) z4 ] j, P<?php foreach ($options as $value) { ?>$ {( I# E* {6 D0 U' e2 X) m J
* q1 ]( d1 v( e: u) q# w
<?php switch ( $value['type'] ) { case 'heading': ?>
, l# s h8 X' @. ]- f5 w- C. q+ y4 M$ n/ Y" Y
<div class="get-option">7 K1 w7 n2 P' V- T4 R0 s
9 H0 N5 [7 V# E( ]7 p {% F* i- Q/ U
<h2><?php echo $value['name']; ?></h2>: R, C% C. A2 p' M+ G4 `+ }0 ~
$ {1 ]7 C5 {8 q- F0 O& {<div class="option-save">2 \/ S, C* A1 [6 P$ K7 a
' |! Q0 P6 Z5 a' `
<?php
* Z$ ]) i% o7 n* Lbreak;
6 ?. V# p* r& D! Qcase 'text':' Z8 N: {! |9 o! K) ^1 U2 a$ j
?>! X. f: C9 \; R h
1 ^4 w6 ~! g- Z; c<div class="description"><?php echo $value['name']; ?></div>0 x( \/ E [8 R% B
<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (
0 s# N0 K7 ]9 a' ] ?" O! o. E6 X9 v" E
get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>- x/ f1 T) C% j4 x S1 C+ X
. V, N/ c1 G0 |; I/ x4 G<?php
$ g# k' G8 z4 u6 I3 W# k, z6 Dbreak;
# ?3 j4 q+ }" e2 Jcase 'select':
* A1 I4 Z% W5 \' A* y?>( o/ \1 j7 V# c( S) @
6 Y; D6 V$ s1 f `, a<div class="description"><?php echo $value['name']; ?></div>
) a/ @1 K7 h5 k4 T6 K<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">
" \/ \9 m! ?* C3 \& m9 Y<?php foreach ($value['options'] as $option) { ?>) f$ }! {( V5 ?" Q; @7 B0 q: h
<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
% z4 |" b( k& v; K<?php } ?>
( @. S6 b* c# M6 T</select> a! E2 M( {3 w5 [
</p>5 a+ D% S8 b0 x+ K2 v/ u: e2 k
7 ?9 _2 F* X/ s8 @/ Z7 Y
<?php% @4 X5 l& H+ n0 F- E, O
break;
+ T1 ]; f+ B4 R) H5 fcase 'textarea':' e- s* U% N5 i% C8 ?
$valuex = $value['id'];
G8 q. Y& [. E! C& I( j4 p' a$valuey = stripslashes($valuex);
8 T6 D$ k8 Q. B" O' T3 Y$video_code = get_settings($valuey);
0 f' s+ T7 B/ d% w( k?>
\ H( p8 b G3 v G& ]* b. O* x3 s7 C
<div class="description"><?php echo $value['name']; ?></div>
) i% s( H. [1 c' L<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }3 {# `) b8 b) A. z' P
0 }; y5 X: X, o
else { echo $value['std']; } ?></textarea></p>
. c* J' v; x2 x9 W- ?# _% y% x
" [1 h; O/ I3 L( O6 f) P5 t6 \, U/ m<?php
; G3 D; q/ B: W& M: B3 }1 S- }5 |break;
' d7 l7 {9 g" ]* N7 Scase 'close':
8 v* {, [' |7 O! ]5 A% j r?>$ g& X, @7 ^9 ]% {7 b1 c) f
( ~ Z3 O# F+ x5 X& C- i( w' ^5 {( ^% F<div class="clearfix"></div>
2 |. x& y- n, }! g @</div><!-- OPTION SAVE END -->
# |/ @9 Y: F# z0 ?$ A/ R' R
) }4 W- w6 }# Q$ ^# p<div class="clearfix"></div>; ]" |2 b( y( A6 }
</div><!-- GET OPTION END -->3 O# x( {/ B( v' o- i/ g: H# ?
2 j2 X/ W; I/ i5 D8 E, d( V
<?php* u$ G+ B, G3 X5 u" I1 d' y a5 B( m! M
break;
7 j, j6 _# p5 ^default;7 r! t3 O- x- w
?>& b: h1 _$ {$ y. `. q
0 m0 A. p' @% ]3 b
, D' ` s0 E6 ~
<?php0 y2 N+ E& K- z. [9 \& ] d
break; } ?>
) |- T) a1 V: o3 t% ~1 E& n$ F8 d( i$ Y
<?php } ?>: x& w7 O* k9 r W1 r
# k+ G. W& N; p8 N( _8 U7 k/ H
<p class="save-p">9 M% @0 r1 F- ]/ e
<input name="save" type="submit" class="sbutton" value="Save Options" />; w3 w" B' b9 q! v4 G% ^
<input type="hidden" name="action" value="save" />* X9 ^5 X# U) _% }7 n
</p>* `) \0 K6 s7 o+ j5 ?4 s. Y* s" L
</form>' V; e; d! b ]/ [5 d/ Z
" i4 }3 g3 f. O o: U% Q: s<form method="post">
$ A/ j% G- ]% u3 \0 X& z<p class="save-p">
. R H% X4 `: i! ~! @7 R7 L( d<input name="reset" type="submit" class="sbutton" value="Reset Options" />6 b: h5 Y' q$ W$ D. J0 i1 ^3 Q3 P0 \
<input type="hidden" name="action" value="reset" />+ s/ u9 A) V( E* x0 o: L
</p>
, r/ W" S3 P w, u- A</form>
9 k4 ?( }4 ?( E- ]4 k9 q6 X0 h; H! X2 q
</div><!-- ADMIN OPTIONS END -->
; n2 H- |& ~) S, F6 X! A0 F
% R) ?1 c6 B0 t) Q/ [ I: Q4 m8 o8 b<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
- X7 A8 I$ W2 s0 h9 H! p
/ \. n$ _, A: p5 Wfunction mytheme_admin_register() {
6 t4 j4 e+ p, Z0 W7 k0 R# `global $themename, $shortname, $options;
4 s6 I& o) h: e& e h a" `if ( $_GET['page'] == basename(__FILE__) ) {
) ^# `8 T9 ~9 K! q2 Uif ( 'save' == $_REQUEST['action'] ) {& b& B5 N# B) U9 P/ @3 _7 O2 T
foreach ($options as $value) {
% z3 Q% S( N. E4 g1 I$ ~$ c- [5 eupdate_option( $value['id'], $_REQUEST[ $value['id'] ] ); }+ {* W: ~6 L \
foreach ($options as $value) {
# d, F" Q9 |+ |( F9 {if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
3 j8 I1 v, N+ u& t) H" oheader("Location: themes.php?page=functions.php&saved=true");
! \$ c; N; a0 I% L+ c: v0 Sdie;% y! m5 W1 A1 q, U
} else if( 'reset' == $_REQUEST['action'] ) {1 C* O9 t* p) \
foreach ($options as $value) {$ P+ x* o* R, ~$ O/ a+ H' B
delete_option( $value['id'] ); }; S- i7 B! E E4 `! A) E
header("Location: themes.php?page=functions.php&reset=true");
# P4 s0 c3 K& u p5 w2 n4 B2 {die;1 ?( l" E; }, k6 t1 J3 l: ^ \+ N! ^
}' S8 D2 Q6 I3 |+ Z8 W- Q
}
' U4 d3 k: p' N8 c! hadd_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');9 j, ]5 c! @: A3 ?# o
}* c6 m3 M2 z6 l6 q4 t8 G* w+ V
% ?3 S& Q3 s0 V2 U# J" M( a1 f( S
function mytheme_admin_head() { ?>6 N8 J- Y7 ?4 A3 u- o+ d
<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />
9 i) y1 c! R$ P' U$ L<?php }: K5 s, n) U5 y( ^
|
|