|
|

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