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