|
|

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