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