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