|
|

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