|
|

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