|
|

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