|
|

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