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