|
|

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