|
|

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