|
|

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